﻿//import "~/_content/HiNcRcl/lib/ace/ace.min.js";
//import "~/_content/HiNcRcl/lib/ace/ext-language_tools.min.js";
//import "~/_content/HiNcRcl/lib/ace/theme-textmate.min.js";
//import "~/_content/HiNcRcl/lib/ace/mode-csharp.min.js";
import "../../lib/ace/ace.min.js";
import "../../lib/ace/ext-language_tools.min.js";
import "../../lib/ace/theme-textmate.min.js";
import "../../lib/ace/mode-csharp.min.js";

export function dispose(domEditorDiv) {
    if (domEditorDiv == null)
        return;
    domEditorDiv.editor.on('input', null);
}
export function setEditorValue(domEditorDiv, text) {
    if (domEditorDiv == null)
        return;
    let session = domEditorDiv.editor.getSession();
    if (session != null)
        session.setValue(text);
}

export function setEditorReadOnly(domEditorDiv, b) {
    if (domEditorDiv == null)
        return;
    let editor = domEditorDiv.editor;
    if (b)
        editor.container.classList.add("bg-secondary-subtle");
    else
        editor.container.classList.remove("bg-secondary-subtle");
    editor.setReadOnly(b);
}